﻿using System.Web.Mvc;
using System.Web.Mvc.Html;
using System.Web.Routing;
using AssemblyVersionPortableArea.Areas.AssemblyVersion;

namespace AssemblyVersionPortableArea
{
	public static class HtmlHelperExtensions
	{
		public static void ShowApplicationVersion(this HtmlHelper helper)
		{
			helper.RenderAction("index", "AssemblyVersion", GetAreaDictionary());
		}
		private static RouteValueDictionary GetAreaDictionary()
		{
			return new RouteValueDictionary( new {area = AssemblyVersionRegistration.Name});
		}
		public static string GetAssemblyListUrl(this UrlHelper urlHelper)
		{
			return urlHelper.Action("list", "AssemblyVersion", GetAreaDictionary());
		}
		public static string GetReleaseNotesUrl(this UrlHelper urlHelper)
		{
			return urlHelper.Action("releasenotes", "AssemblyVersion", GetAreaDictionary());
		}
	}
}